-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(autoware_utils): porting from autoware_universe_utils #23
Conversation
Signed-off-by: JianKangEgon <[email protected]>
Signed-off-by: JianKangEgon <[email protected]>
Signed-off-by: JianKangEgon <[email protected]>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Signed-off-by: JianKangEgon <[email protected]>
Signed-off-by: JianKangEgon <[email protected]>
Signed-off-by: JianKangEgon <[email protected]>
Signed-off-by: JianKangEgon <[email protected]>
… same namespace will cause compile error when triggering template specilization Signed-off-by: NorahXiong <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the PR title and description are not correct. Please update them properly first.
Hi, it's a bit hard to review since the PR is quite big. Is it possible to break it into pieces? Maybe breaking it into the following the include directory structure might be good:
|
Sorry, please ignore my comment above. I think we will be able to review it with the current size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the coding conventions we have, code must live under a namespace like:
autoware::PACKAGE_NAME
@JianKangEgon I've added a bunch of suggestions that you can just accept.
#include <utility> | ||
#include <vector> | ||
|
||
namespace autoware_utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The namespace for all the header files needs to be autoware::utils
namespace autoware_utils | |
namespace autoware::utils |
|
||
#include <geometry_msgs/msg/point.hpp> | ||
|
||
namespace autoware_utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace autoware_utils | |
namespace autoware::utils |
point.z() = msg.z; | ||
return point; | ||
} | ||
} // namespace autoware_utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} // namespace autoware_utils | |
} // namespace autoware::utils |
|
||
#include <vector> | ||
|
||
namespace autoware_utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace autoware_utils | |
namespace autoware::utils |
const double base_to_rear, const double width); | ||
double get_area(const autoware_perception_msgs::msg::Shape & shape); | ||
Polygon2d expand_polygon(const Polygon2d & input_polygon, const double offset); | ||
} // namespace autoware_utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} // namespace autoware_utils | |
} // namespace autoware::utils |
const std::function< | ||
bool(const autoware_utils::Polygon2d &, const autoware_utils::Polygon2d &)> &); | ||
|
||
} // namespace autoware_utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} // namespace autoware_utils | |
} // namespace autoware::utils |
|
||
#include <autoware_utils/geometry/geometry.hpp> | ||
|
||
namespace autoware_utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace autoware_utils | |
namespace autoware::utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing, esteve san
we have change the name space according to your comment
Have a nice day!
/// @param max points will be generated in the range [-max,max] | ||
/// @details algorithm from https://cglab.ca/~sander/misc/ConvexGeneration/convex.html | ||
Polygon2d random_convex_polygon(const size_t vertices, const double max); | ||
} // namespace autoware_utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} // namespace autoware_utils | |
} // namespace autoware::utils |
|
||
#include "autoware_utils/geometry/boost_geometry.hpp" | ||
|
||
namespace autoware_utils::sat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace autoware_utils::sat | |
namespace autoware::utils::sat |
*/ | ||
bool intersects(const Polygon2d & convex_polygon1, const Polygon2d & convex_polygon2); | ||
|
||
} // namespace autoware_utils::sat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} // namespace autoware_utils::sat | |
} // namespace autoware::utils::sat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including too many files has led to poor maintainability, and including autoware_utils.hpp
results in significant dependencies.
Therefore, for example, how about creating autoware_utils/geometry.hpp
, which consolidates the includes under autoware_utils/geometry
, and including it in autoware_utils.hpp
? This way, files that only need geometry
will not be affected by other dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a porting PR, so this fix can be included in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with you kondo san, @youtalk
Let‘s porting first then divide it in core repo in another pr
have a nice day
心刚
Signed-off-by: JianKangEgon <[email protected]>
I think this is a good point. However, this modification requires changes to different repositories that depend on this package as well (e.g., in autoware_lanelet2_extension, autoware.universe, etc.). I suggest we can focus first on moving the function from autoware_universe_utils to autoware_utils in this PR, then do namespace refactoring in another PR. We probably have to change the directory structure as well. |
…updated in further version Signed-off-by: JianKangEgon <[email protected]>
Good afternoon, mits san @mitsudome-r autoware_utils pr already revert, please help us review and merge it Best regards |
Good afternoon Kondo San @youtalk Thanks for reviewing this pr, can you indicate the issue in the title and description of the pr. I will inform the engineer to modify according to your comment Best Regards 心刚 |
The respective packages in I propose we just move the code and keep the convention that's already implemented in |
I get your point , esteve san. @esteve I have a meeting with mits san yesterday, and his idea is we merge this pr first keep "autoware_util::xxx" name space pattern and followed by a pr to change namespace to "autoware::xxx" along with the modifications of package under core repo which use autoware_utils is this solution ok to you? Best regards 心刚 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not autoware.core
or autoware.universe
, but the autoware_utils
repository, so even if the namespace rules are different, it can still be somewhat understood.
I've changed the PR's title.
@mitsudome-r Many PRs depend on this and can’t be merged, so although the issue with @esteve’s namespace remains, shall we proceed with a bypass merge? |
I think we also have an issue that this package is already released as 1.0.0 in ROS Buildfarm. We might want to be careful with changing the API in the same distribution. We probably should do the namespace when we prepare the release for 2.0.0. Since this is being a blocker for many other PRs, let's merge it and do the namespace renaming in another occasion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks okay with me.
I was under the impression that the code conventions apply to all the projects in the |
@JianKangEgon @mitsudome-r @youtalk @xmfcx my mistake, sorry, I thought that the After all the PRs have been merged we can discuss whether we should follow the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JianKangEgon LGTM, thanks!
Description
We are porting package autoware_universe_utils to autoware.core, and this PR adds the package to core.
How was this PR tested?
Notes for reviewers
None.
Effects on system behavior
None.